The present invention relates to a disk drive and, more particularly, to a disk drive, such as an optical disk drive, that uses a read-ahead scheme whereby when reading the requested segment of data, the subsequent segments of data are also read out and stored in advance in a data buffer.
Conventionally, a disk drive that uses an optical disk such as a CD-R (compact disk-recordable) or MO (Magneto-Optical disk) is used in many cases by connecting it to a host computer, i.e., a host device, via a specified interface such as a SCSI interface. In such use conditions, the transfer speed of data from the disk drive to the host computer is faster than the data read speed of the disk drive. Further, when the host computer reads data from an optical disk, it is often the case that data are read sequentially from consecutive addresses on the optical disk.
For this reason, in an optical disk reading device such as a CD-ROM drive or an MO drive, when a read command for data at a particular address on the optical disk is input from the host computer into the disk drive, the disk drive usually performs so-called read ahead, that is, at the same time that the data at the specified address is read out and stored in a data buffer, data at the subsequent addresses are also read out from the optical disk and stored in the data buffer.
If data at the subsequent addresses have been read ahead and stored in the data buffer following the data read from the specified address on the optical disk, as described above, then, when the address specified by the next read instruction from the host computer is one that immediately follows the previously specified read address, data stored in the data buffer can be transferred to the host computer without having to read it from the optical disk; this enhances read performance for accesses made from the host computer.
Such a data read-ahead scheme for a disk drive is disclosed, for example, in Japanese Unexamined Patent Publication No. 7-73654.
However, the prior art read-ahead scheme has had the problem that when an interrupt, due to an error or the like, occurs during a read-ahead operation in the disk drive, the operation of the host computer stops because the read-ahead operation is aborted with no retries made to execute the read ahead from the address at which the interrupt occurred.
Accordingly, it is a first object of the present invention to provide a disk drive that can prevent degradation of overall system performance by using the readout control function of the host device and making provisions at the host device side to prevent the read-ahead operation from being aborted when an interrupt, due to an error or the like, occurs during the read-ahead of data from a disk.
It is a second object of the present invention to provide a disk drive that has an improved read-ahead operation control function with provisions made at the disk drive side to prevent the read-ahead operation from being aborted when an interrupt, due to an error or the like, occurs during the read-ahead of data from a disk.
According to a first aspect of the present invention which attains the above objects, there is provided a disk drive comprising a reproducing part connected to a host device via an interface for reproducing data recorded on a disk, a buffer memory for storing the reproduced data, and a control part for causing the reproducing part to reproduce data in accordance with an address contained in a data read signal supplied from the host device, and for transferring the reproduced data to the host device after temporarily storing the reproduced data in the buffer memory, the disk drive characterized by the provision of: a read-ahead processing part for performing a read-ahead operation by sequentially reading ahead data from addresses starting at the address that immediately follows the address contained in the data read signal supplied from the host device; an error occurrence detecting part for detecting the occurrence of an error during the read-ahead operation; an error occurrence reporting part for suspending, when the occurrence of an error is detected, the read-ahead operation at the address at which the error occurred, and for reporting the occurrence of the error to the host device; and a read-ahead operation resume instructing part for instructing, upon receiving a prescribed command from the host device after reporting the occurrence of the error to the host device, the read-ahead processing part to resume the read-ahead operation from the address at which the read-ahead operation was suspended.
According to a second aspect of the present invention, in the disk drive of the first aspect, when the error occurrence detecting part detects the occurrence of a read-ahead error at the same address for a second time, the read-ahead operation resume instructing part instructs the read-ahead processing part to resume the read-ahead operation from the address that immediately follows the error-detected address, without causing the error occurrence reporting part to suspend the read-ahead operation, and at the same time, changes the contents of the buffer memory where read-ahead data is mapped.
According to the first and second aspects, even when an interrupt due to an error or the like occurs during the read-ahead of data from the disk, the overall performance of the system does not drop, because provisions are made at the host device side to prevent the read-ahead operation from being aborted, by utilizing the readout control function of the host device.
According to a third aspect of the present invention, there is provided a disk drive comprising a reproducing part connected to a host device via an interface for reproducing data recorded on a disk, a buffer memory for storing the reproduced data, and a control part for causing the reproducing part to reproduce data in accordance with an address contained in a data read signal supplied from the host device, and for transferring the reproduced data to the host device after temporarily storing the reproduced data in the buffer memory, the disk drive characterized by the provision of: a read-ahead processing part for performing a read-ahead operation by sequentially reading ahead data from addresses starting at the address that immediately follows the address contained in the data read signal supplied from the host device; an error occurrence detecting part for detecting the occurrence of an error during the read-ahead operation; and a retry part for performing a retry when the occurrence of an error is detected, by retrying the read-ahead operation from the address at which the error occurred.
According to a fourth aspect of the present invention, in the disk drive of the third aspect, the retry part performs the retry successively a predetermined number of times or for a predetermined time.
According to a fifth aspect of the present invention, in the disk drive of the fourth aspect, if the error persists even after the retry has been performed successively the predetermined number of times or for the predetermined time, the retry part stops performing the retry and waits for an instruction from the host device.
According to a sixth aspect of the present invention, in the disk drive of the fourth aspect, if the retry has been performed successively more than the predetermined number of times or for more than the predetermined time, the retry part resumes the read-ahead operation from the address that immediately follows the address at which the error occurred, and at the same time, changes the contents of the buffer memory where read ahead data is mapped.
According to the third to sixth aspects, even when an interrupt due to an error or the like occurs during the read-ahead of data from the disk, the read-ahead operation can be prevented from being aborted at the disk drive side by using the read-ahead operation control function of the disk drive.
According to a seventh aspect of the present invention, the disk drive of any one of the first to sixth aspects further includes a writing part for writing data to the disk wherein, when a data write command is issued from the host device during the read-ahead operation of the read-ahead processing part, the read-ahead processing part suspends the read-ahead operation and, after data writing by the writing part is completed, resumes the read-ahead operation from the address at which the read-ahead operation was suspended.
According to an eighth aspect of the present invention, in the disk drive of any one of the first to sixth aspects, when a data read command for a specific predetermined address is issued from the host device during the read-ahead operation of the read-ahead processing part, the read-ahead processing part temporarily suspends the read-ahead operation, but does not perform read ahead for the specific address but resumes the read-ahead operation from the address at which the read-ahead operation was suspended.
According to a ninth aspect of the present invention, in the disk drive of any one of the first to sixth aspects, when a designated reset command is issued from the host device during the read-ahead operation of the read-ahead processing part, the read-ahead processing part suspends the read-ahead operation and, after resetting by the reset command is completed, resumes the read-ahead operation from the address at which the read-ahead operation was suspended.
According to the seventh to ninth aspects, even when a write command, a read command for a specific address, or a reset command arrives during the read-ahead operation, the read-ahead operation is not aborted because the read-ahead operation is resumed when the processing specified by the command is completed.
According to a 10th aspect of the present invention, in the disk drive of any one of the first to sixth aspects, when a specific predetermined address is reached during the read-ahead operation of the read-ahead processing part, the read-ahead processing part temporarily suspends the read-ahead operation, skips the specific address, and resumes the read-ahead operation from the address that immediately follows the specific address, while at the same time, changing the contents of the buffer memory where read ahead data is mapped.
According to the 10th aspect, when a specific predetermined address not needing read ahead is reached during the read-ahead operation, the read-ahead operation skips the address not needing read ahead and proceeds to read ahead data at the next address, and the read ahead data is mapped in a different table; in this way, needless read ahead can be eliminated.
According to an 11th aspect of the present invention, the disk drive of any one of the first to sixth aspects further comprises a nonvolatile internal memory, and is characterized by the provision of: an ID confirming part for confirming an ID number recorded on the disk each time the disk is loaded into the disk drive; a first read address storing part for storing a first read address in the nonvolatile memory in association with the ID number, the first read address being one received from the host device for the first time after the disk is loaded into the disk drive; and a preceding read-ahead processing part for searching the first read address storing part for the ID number of the disk and its associated first read address when the disk is loaded into the disk drive and, when the ID number and the associated first read address are found, causing the read-ahead processing part to perform a read-ahead operation starting from the first read address.
According to a 12th aspect of the present invention, the disk drive of any one of the first to sixth aspects further comprises a nonvolatile internal memory, and is characterized by the provision of: an ID confirming part for confirming an ID number recorded on the disk each time the disk is loaded into the disk drive; a first read address storing part for storing a first read address in the nonvolatile memory in association with the ID number, the first read address being one received from the host device for the first time after the disk is loaded into the disk drive; a first read address storing frequency calculating part for calculating for each ID number a frequency representing the number of times that the first read address is stored by the first read address storing part; and a preceding read-ahead processing part for searching the first read address storing part for the ID number of the disk and its associated first read address when the disk is loaded into the disk drive and, when the ID number and the associated first read address are found, causing the read-ahead processing part to perform a read-ahead operation starting from the first read address whose frequency calculated by the first read address storing frequency calculating part is the highest.
According to the 11th and 12th aspects, when the disk is loaded into the disk drive, the disk ID is checked, and the read-ahead operation is performed based on the frequency of the first address specified when the same disk was loaded previously, or on the same address as the previously specified first address; accordingly, when the read command for the same address arrives first, processing time can be reduced.